Improve NS dialogs. Add close button, remove ugly casts.
authorJan D. <jan.h.d@swipnet.se>
Tue, 28 Aug 2012 16:05:17 +0000 (18:05 +0200)
committerJan D. <jan.h.d@swipnet.se>
Tue, 28 Aug 2012 16:05:17 +0000 (18:05 +0200)
commit032b7066a69caafc33feb525d1e09d5f25ea01be
treec0cbef7bb31db5a8b5017abcd9625a3268ff65c3
parentae56596309949b288ab27bb3df5ea51dd5b9b0e5
Improve NS dialogs.  Add close button, remove ugly casts.

* nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
button_values to NULL. Call setStykeMask so dialogs get a close button.
(windowShouldClose:): Set window_closed.
(dealloc): New member, free button_values.
(process_dialog:): Make member function. Remove window argument,
replace window with self. Count buttons and allocate and store values
in button_values.
(addButton:value:row:): value is int with the name tag.  Call setTag
with tag. Remove return self, declare return value as void.
(addString:row:): Remove return self, declare return value as void.
(addSplit): Remove return self, declare return value as void.
(clicked:): Remove return self, declare return value as void.
Set dialog_return to button_values[seltag]. Code formatting change.
(initFromContents:isQuestion:): Adjust call to process_dialog.
Code formatting change.
(timeout_handler:): Set timer_fired to YES.
(runDialogAt:): Set timer_fired to NO.
Handle click on close button as quit.

* nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
Add window_closed and button_values.  Add void as return value for
add(Button|String|Split).  addButton takes int instead of Lisp_Object.
Add process_dialog as new member.
src/ChangeLog
src/nsmenu.m
src/nsterm.h